<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link href="./css/api.css" rel="stylesheet"/>
  <link href="./css/element.css" rel="stylesheet"/>
  <link href="./css/base.css" rel="stylesheet"/>
  <title>登录</title>
</head>
<body>
  <div id="vm" v-cloak>
    <header class="x-header">
      <i class="el-icon-arrow-left x-closewin-icon" @click="closethiswin"></i>
      <div class="x-header-t">喜家德餐饮管理有限公司</div>
    </header>
    <div class="x-code-desc">
      <div class="x-code-l"></div>
      <div class="x-co-right">
        <div class="x-co-label">面试官：<div class="x-co-name">潘霞</div></div>
        <div class="x-co-label">面试区域：<div class="x-co-name">大连直营李宛鸿区域</div></div>
      </div>
    </div>
    <!--  -->
    <div class="x-code-codebox">
      <div class="x-code-data" :style="{'background':'url('+ codeimg +')no-repeat center','background-size':'contain'}"></div>
    </div>
    <div class="x-mana-btn" @click="startface">开始面试</div>
  </div>
  <script type="text/javascript" src="./script/vue.js"></script>
  <script type="text/javascript" src="./script/element.js"></script>
  <script type="text/javascript" src="./script/api.js"></script>
  <script type="text/javascript" src="./js/base.js"></script>
  <script>
    apiready = function () {
      //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          codeimg:''
        }
      },
      created:function() {
        var that=this;

      },
      mounted:function(){
        var that=this;
        that.getcode()
      },
      methods: {
        getcode:function(){
          var that=this;
          api.ajax({
            url:manaurltwo+'qr',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('usertoken')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                that.codeimg = ret.data.file;

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
        startface:function(){
          var that=this;
          api.ajax({
            url:manaurltwo+'start',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('usertoken')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                openmanawin("soundrecord","soundrecord.html")

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
      }
    })
    }
  </script>
</body>
</html>
